package actions;

import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.TreeSet;

import filters.InvalidFilterParameterException;

public class PrintTo extends AbstractAction {

	
	protected PrintTo() {
		_parameterList = new ArrayList<String>();
		_parameterList.add("STDOUT");
		_parameterList.add("STDERR");
	}
	
	@Override
	public void performAction(TreeSet<File> filteredSet, String parameter){
		if(parameter.equals("STDOUT")) {
			for(Iterator<File> it1=filteredSet.iterator();it1.hasNext();) {
				System.out.println(it1.next().getAbsolutePath());
			}
		}
		if(parameter.equals("STDERR")) {
			for(Iterator<File> it1=filteredSet.iterator();it1.hasNext();) {
				System.err.println(it1.next().getAbsolutePath());
			}
		}
	}

}
